From b69a6155f6a96bcd810843945d059d4ad6815952 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Tue, 27 Jun 2006 20:54:40 +0000 Subject: [PATCH] Add table "filearchive" --- maintenance/postgres/tables.sql | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index 82c91d6cc6..4bec46121e 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -167,7 +167,7 @@ CREATE TABLE site_stats ( ss_good_articles INTEGER DEFAULT 0, ss_total_pages INTEGER DEFAULT -1, ss_users INTEGER DEFAULT -1, - ss_admins INTEGER DEFAULT -1 + ss_admins INTEGER DEFAULT -1, ss_images INTEGER DEFAULT 0 ); @@ -227,6 +227,35 @@ CREATE TABLE oldimage ( ); CREATE INDEX oi_name ON oldimage (oi_name); + +CREATE TABLE filearchive ( + fa_id SERIAL NOT NULL PRIMARY KEY, + fa_name TEXT NOT NULL, + fa_archive_name TEXT, + fa_storage_group VARCHAR(16), + fa_storage_key CHAR(64), + fa_deleted_user INTEGER NULL REFERENCES "user"(user_id) ON DELETE SET NULL, + fa_deleted_timestamp TIMESTAMPTZ NOT NULL, + fa_deleted_reason TEXT, + fa_size SMALLINT NOT NULL, + fa_width SMALLINT NOT NULL, + fa_height SMALLINT NOT NULL, + fa_metadata TEXT, + fa_bits SMALLINT, + fa_media_type TEXT, + fa_major_mime TEXT DEFAULT 'unknown', + fa_minor_mime TEXT DEFAULT 'unknown', + fa_description TEXT NOT NULL, + fa_user INTEGER NULL REFERENCES "user"(user_id) ON DELETE SET NULL, + fa_user_text TEXT NOT NULL, + fa_timestamp TIMESTAMPTZ +); +CREATE INDEX fa_name_time ON filearchive(fa_name, fa_timestamp); +CREATE INDEX fa_dupe ON filearchive(fa_storage_group, fa_storage_key); +CREATE INDEX fa_notime ON filearchive(fa_deleted_timestamp); +CREATE INDEX fa_nouser ON filearchive(fa_deleted_user); + + CREATE SEQUENCE rc_rc_id_seq; CREATE TABLE recentchanges ( rc_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('rc_rc_id_seq'), -- 2.20.1